package com.bupt.liutong.admin.sch.form;

import java.util.Date;

import javax.servlet.http.HttpServletRequest;
import org.apache.struts.action.ActionErrors;
import org.apache.struts.action.ActionMapping;

import com.bupt.liutong.admin.core.base.BaseForm;
import com.bupt.liutong.util.DateUtils;

public class NewsForm extends BaseForm {

	private static final long serialVersionUID = 291688109443514255L;
	private Integer id;
	private String title;
	private String des;
	private String author;
	private Integer top;
	private String topStr;
	private Integer enabled;
	private String enabledStr;
	private Date createTime;
	private String createTimeStr;

	public Integer getId() {
		return id;
	}

	public void setId(Integer id) {
		this.id = id;
	}

	public String getTitle() {
		return title;
	}

	public void setTitle(String title) {
		this.title = title;
	}

	public String getDes() {
		return des;
	}

	public void setDes(String des) {
		this.des = des;
	}

	public String getAuthor() {
		return author;
	}

	public void setAuthor(String author) {
		this.author = author;
	}

	public Integer getTop() {
		return top;
	}

	public void setTop(Integer top) {
		this.top = top;
		if (top != null) {
			topStr = ctm.get("yesOrNo").get(top.toString());
		}
	}

	public String getTopStr() {
		return topStr;
	}

	public void setTopStr(String topStr) {
		this.topStr = topStr;
	}

	public Integer getEnabled() {
		return enabled;
	}

	public void setEnabled(Integer enabled) {
		this.enabled = enabled;
		if(enabled != null)
			enabledStr = ctm.get("yesOrNo").get(enabled.toString());
	}

	public String getEnabledStr() {
		return enabledStr;
	}

	public void setEnabledStr(String enabledStr) {
		this.enabledStr = enabledStr;
	}

	public Date getCreateTime() {
		return createTime;
	}

	public void setCreateTime(Date createTime) {
		this.createTime = createTime;
		if (createTime != null)
			createTimeStr = DateUtils.getDateStr(createTime);
	}

	public String getCreateTimeStr() {
		return createTimeStr;
	}

	public void setCreateTimeStr(String createTimeStr) {
		this.createTimeStr = createTimeStr;
		if (createTimeStr != null)
			createTime = DateUtils.getDate(createTimeStr);
	}

	/**
	 * Method validate
	 * 
	 * @param mapping
	 * @param request
	 * @return ActionErrors
	 */
	public ActionErrors validate(ActionMapping mapping,
			HttpServletRequest request) {
		// TODO Auto-generated method stub
		return null;
	}

	/**
	 * Method reset
	 * 
	 * @param mapping
	 * @param request
	 */
	public void reset(ActionMapping mapping, HttpServletRequest request) {
		// TODO Auto-generated method stub
	}
}
